package cn.ssm.service.serviceImpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.ssm.dao.OrderDetailMapper;
import cn.ssm.pojo.OrderDetail;
import cn.ssm.service.OrderDetailService;

/**
 * 订单详情业务实现类
 * 
 * @author 黄少涛
 *
 */
@Service
public class OrderDetailServiceImpl implements OrderDetailService {
	@Autowired
	private OrderDetailMapper orderDetailMapper;

	// 查询全部订单
	@Override
	public List<OrderDetail> getOrderList(Map<String, Object> paramas) {
		return orderDetailMapper.getOrderList(paramas);
	}

	// 查询订单总数量
	@Override
	public int getOrderCount(Map<String, Object> map) {

		return orderDetailMapper.getOrderCount(map);
	}
	
	// 查询日期价格总和 
	@Override
	public double getTodaySum(Map<String, Object> map) {
		
		return orderDetailMapper.getTodaySum(map);
	}
	
	//通过订单Id查询订单信息与用户手机号
	@Override
	public OrderDetail getBuyTimeAndPhoneByOrderId(Map<String, Object> map) {
		
		return orderDetailMapper.getBuyTimeAndPhoneByOrderId(map);
	}
	
	//查询每月订单总数
	@Override
	public List<String> getOrderMonthData() {
		
		return orderDetailMapper.getOrderMonthData();
	}

	@Override
	public int getOrderSeatBySchedule(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return orderDetailMapper.getOrderSeatBySchedule(map);
	}
	
	//增加订单
	@Override
	public int addOrder(Map<String, Object> map) {
		
		return orderDetailMapper.addOrder(map);
	}
	

	//查询最新的订单id与购买时间
	@Override
	public OrderDetail getOrderMaxIdMaxBuyDate() {
		
		return orderDetailMapper.getOrderMaxIdMaxBuyDate();
	}
	
	//修改订单
	@Override
	public int updateOrder(Map<String, Object> map) {
		
		return orderDetailMapper.updateOrder(map);
	}
	
	//删除订单
	@Override
	public int deleteOrder(Map<String, Object> map) {
	
		return orderDetailMapper.deleteOrder(map);
	}
	
	//获取订单状态id
	@Override
	public int getOrderIsActiveId(Map<String, Object> map) {
		
		return orderDetailMapper.getOrderIsActiveId(map);
	}
	
	
	
	
	
	
	
	
	//根据UserName查订单总数  朱海松
	@Override
	public int getCountByUserName(Map<String, Object> paramas) {
		return orderDetailMapper.getCountByUserName(paramas);
	}

	//根据UserName查订单 朱海松
	@Override
	public List<OrderDetail> getListByUserName(Map<String, Object> paramas) {
		return orderDetailMapper.getListByUserName(paramas);
	}

	


	

	



}
